Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Nonce attribute of IssueAsset Transaction #385

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zhengq1
Copy link
Contributor

@zhengq1 zhengq1 commented Aug 7, 2017

Signed-off-by: zhengq1 [email protected]

return nil
}

func (a *IssueAsset) Deserialize(r io.Reader, version byte) error {
var err error
a.Nonce, err = serialization.ReadUint64(r)
if err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cannot judge to err, return err directly.

@@ -14,9 +18,18 @@ func (a *IssueAsset) Data(version byte) []byte {
}

func (a *IssueAsset) Serialize(w io.Writer, version byte) error {
err := serialization.WriteUint64(w, a.Nonce)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cannot judge to err, return err directly.

return serialization.WriteUint64(w, a.Nonce)

@zhengq1
Copy link
Contributor Author

zhengq1 commented Aug 9, 2017

got it.

Copy link
Collaborator

@dreamfly281 dreamfly281 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is already a nonce existed in the Transaction header, it looks duplicate to add another nonce field in the payload

@zhengq1
Copy link
Contributor Author

zhengq1 commented Aug 15, 2017

Nonce in transaction struct is reserved for balance model, if use UTXO model, transaction which need nonce can add it to payload.

@Arbio5zt
Copy link
Member

agree with zhengq1, this nonce is used to allow issuer to create multiple issue transaction with the just same value.

Honglei-Cong pushed a commit to Honglei-Cong/DNA that referenced this pull request Nov 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants